package com.woniuxy.service.impl;

import com.woniuxy.dao.ManagerDao;
import com.woniuxy.entity.Game;
import com.woniuxy.service.ManagerService;

import java.util.List;
import java.util.Map;

public class ManagerServiceImpl implements ManagerService {
    private ManagerDao managerDao;
    public void setManagerDao(ManagerDao managerDao) {
        this.managerDao = managerDao;
    }
    public List<Game> findAll() {
        return managerDao.findAll();
    }

    @Override
    public int selectCount() {
        return managerDao.selectCount();
    }

    @Override
    public boolean insertGame(Game game) {
        if(managerDao.insertGame(game)){
            return true;
        }
        return false;
    }

    @Override
    public boolean delete(int id) {
        if(managerDao.delete(id)){
            return true;
        }
        return false;
    }

    @Override
    public int gameUpdate(Game game) {
        return managerDao.gameUpdate(game);
    }

    public List<Game> findByName(String username) {
        return ManagerDao.findOneByLikeName(username);
    }

    public List<Game> findByIds(Integer[] ids) {
        return ManagerDao.findByIds(ids);
    }

    public int addOne(ManagerServiceImpl manager) {
        int i = ManagerDao.addOne(manager);
        return i;
    }

    public int addOneForMap(Map<String, Object> userinfo) {
        return ManagerDao.addOneForMap(userinfo);
    }
}
